Skip to content

chore: add squash gen for better rebasing#2996

Open
qstearns wants to merge 3 commits into
mainfrom
quinn/squash-gen
Open

chore: add squash gen for better rebasing#2996
qstearns wants to merge 3 commits into
mainfrom
quinn/squash-gen

Conversation

@qstearns
Copy link
Copy Markdown
Contributor

@qstearns qstearns commented May 22, 2026

It's getting vibe-y in here

this can make reviewing a PR like this:

https://github.com/speakeasy-api/gram/pull/2965/changes

to more like this (with one easy commit filter)
https://github.com/speakeasy-api/gram/pull/2965/changes/BASE..1dfb316f23346b808762769feb41df06ff83e9e7

This thing re-writes your whole commit history to reset all generated files to
match the merge-base on origin/main (or the previous explicit gen commit). It then bundles up all the
generated code into a single commit.

This let's you run rebases in a pleasant manner
without crashing into a billion merge conflicts

It works nicely with git rebase TODOs with directives like:

x mise git:squash-gen
x mise git:squash-gen --drop
x mise git:squash-gen --amend

qstearns added 2 commits May 21, 2026 20:27
This thing re-writes your whole commit history to
match the merge-base with origin main (or the previous
explicit gen commit). It then bundles up all the
generated code into a single commit.

This let's you run rebases in a pleasant manner
without crashing into a billion merge conflicts

It works nicely with git rebase TODOs with:

x mise git:squash-gen
x mise git:squash-gen --drop
x mise git:squash-gen --amend
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 22, 2026 4:07am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 2043491

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@qstearns qstearns marked this pull request as ready for review May 23, 2026 01:07
@qstearns qstearns requested a review from a team as a code owner May 23, 2026 01:07
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 204349115b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// ---------- precondition checks ----------------------------------------------

async function assertCleanWorktree(): Promise<void> {
const status = await git("status", "--porcelain", "--untracked-files=no");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject untracked files before squashing generated artifacts

assertCleanWorktree only checks tracked changes (--untracked-files=no), but the later staging step explicitly includes untracked files (git ls-files --others --exclude-standard). That means an unrelated untracked file under a generated path (for example, a stale file left in server/gen/ or client/sdk/) will be silently swept into the new chore(gen) commit, which can pollute history with unintended artifacts. The precondition should fail when untracked files are present (or at least when untracked generated files are present) to keep the rewrite deterministic.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant